package interactions;

import sprite.Sprite;
import spritebehavior.Behavior;


/**
 * This class stores the types of a pair of two different Sprites. A type of
 * Sprite is defined by the Behavior strategy it has. So it's actually a pair of
 * Behaviors.
 * 
 * @author Yaqi Zhang
 * 
 */
public class SpritesTypePair {
    private Class<? extends Behavior> mySP1type;
    private Class<? extends Behavior> mySP2type;

    /**
     * Given sprite 1 and sprite 2, create a SpriteTypePair.
     * 
     * @param sp1 sprite 1
     * @param sp2 sprite 2
     */
    public SpritesTypePair (Sprite sp1, Sprite sp2) {
        mySP1type = sp1.getType();
        mySP2type = sp2.getType();
    }

    /**
     * @param sp1Type type of Sprite 1
     * @param sp2Type type of Sprite 2
     */
    public SpritesTypePair (Class<? extends Behavior> sp1Type,
            Class<? extends Behavior> sp2Type) {
        mySP1type = sp1Type;
        mySP2type = sp2Type;
    }

    /**
     * @param sp SpritesPair
     * @return
     */
    public boolean equal (SpritesTypePair sp) {
        if (sp.mySP1type.equals(mySP1type) && sp.mySP2type.equals(mySP2type)) { return true; }
        if (sp.mySP2type.equals(mySP1type) && sp.mySP1type.equals(mySP2type)) { return true; }
        return false;
    }
    // public static void main(String[] args){
    // List a = new ArrayList<String>();
    // System.out.print(a.getClass());
    // }
}
